<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="chtml" uri="http://www.szhelper.com/jsp/html"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN" lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>列表</title>
<script type="text/javascript">
var postPath = "<%=request.getContextPath()%>";
function smsRegistEx(){
	if(window.confirm('需要激活序列号吗？只需激活一次')){
		helper.fun.send(postPath+'/scc/registEx',null,function(data){
			if(data.results==true){alert('激活成功');
			}else{alert('激活失败');}
		});
	}
}

function smsRegistDetailInfo(){
	if(window.confirm('需要注册公司吗？只需注册一次')){
		helper.fun.send(postPath+'/scc/registDetail',null,function(data){
			if(data.results==true){alert('注册成功');
			}else{alert('注册失败');}
		});
	}
}

function smsLogout(){
	if(window.confirm('需要注销短信组件吗？注销后需要再次激活才能使用')){
		helper.fun.send(postPath+'/scc/logout',null,function(data){
			if(data.results==true){alert('注销成功');
			}else{alert('注销失败');}
		});
	}
}
function smspwdupdate(){
	if(window.confirm('需要修改短信组件密码吗？')){
		helper.fun.send(postPath+'/scc/pwdUpdate',null,function(data){
			if(data.results==true){alert('修改成功');
			}else{alert('修改失败');}
		});
	}
}

function smsBalance(){
	helper.fun.send(postPath+'/scc/balance',null,function(data){
		var moneyBalance=data;
		$("#money").html(moneyBalance.account);
	});
}

function smsTextSend(){
	var test_mobile = document.getElementById("test_mobile").value;
	helper.fun.send(postPath+'/scc/send/' + test_mobile,null,function(data){
		if(data.results==true){alert('发送成功');
		}else{alert('发送失败');}
	});
}

</script>
</head>
<body>
<div id="content">
<table width="99%" align="center" border="1" cellpadding="0"
	cellspacing="0" class="data_table">
	<tr>
		<td class="data_tab_th" colspan="4"><img src='<chtml:path  path="/" />images/form.gif' width="16" height="16" />短信组件信息</td>
	</tr>
	<tr>
		<td class="data_tab_tdr">激活序列号:</td>
		<td class="data_tab_td" style="text-align: left;"><input type="button" value="·激活·" onclick="javascript:smsRegistEx();" /></td>
		<td class="data_tab_tdr">企业信息注册:</td>
		<td class="data_tab_td" style="text-align: left;"><input type="button" value="·注册·" onclick="javascript:smsRegistDetailInfo();" /></td>
		<td class="data_tab_tdr">软件注销:</td>
		<td class="data_tab_td" style="text-align: left;"><input type="button" value="·注销·" onclick="javascript:smsLogout();" /></td>
		<td class="data_tab_tdr">修改密码:</td>
		<td class="data_tab_td" style="text-align: left;"><input type="button" value="·修改·" onclick="javascript:smspwdupdate();" /></td>
	</tr>
	<tr>
		<td class="data_tab_tdr">查询余额:</td>
		<td class="data_tab_td" style="text-align: left;"><input type="button" value="·查询·" onclick="javascript:smsBalance();" /></td>
		<td class="data_tab_td" colspan="2" style="text-align: left;"><span id="money"></span>元</td>
		<td class="data_tab_tdr">测试手机号:</td>
		<td class="data_tab_td" style="text-align: left;">
			<input type="text" id="test_mobile" />
			<input type="button" value="·测试连接·" onclick="javascript:smsTextSend();" />
		</td>
		<td class="data_tab_tdr"></td>
		<td class="data_tab_td"></td>
	</tr>
</table>
<br />
</div>
</body>
</html>